package com.rran.study.designpattern.behavioral.chain.chain;


/**
 * @author yy
 * @Type AbstractAttackChain.java
 * @Desc
 * @date 2020/7/20 14:44
 */
public abstract class AbstractAttackChain implements ChainHandler {

    protected Integer handlerId;

    protected Integer next;

    protected Boolean isHead;

    protected ChainHandler nextChain;

    @Override
    public void setNextChain(ChainHandler chainHandler) {
        this.nextChain = chainHandler;
    }

    @Override
    public Integer getNextChainId(){
        return this.next;
    }

    @Override
    public void handle() {
        attack();
    }

    public abstract void attack();

    public void setHandlerId(Integer handlerId) {
        this.handlerId = handlerId;
    }

    public void setNext(Integer next) {
        this.next = next;
    }

    public void setHead(Boolean head) {
        isHead = head;
    }
}
